package com.hykj.dao;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.hykj.toolsbean.DB;
import com.hykj.valuebean.UserBean;

public class UserDao {
	public UserBean getLoginer(String user, String pswd) throws SQLException {
		String sql = "select * from tb_user where user=? and pswd=?";
		Object[] params = {user, pswd};
		DB mydb = new DB();
		UserBean userIns = new UserBean();
		mydb.doPstm(sql, params);
		ResultSet rs = mydb.getRs();
		if (rs != null && rs.next()) {
			userIns.setUser(rs.getString(2));
			userIns.setPswd(rs.getString(3));
			rs.close();
		}
		mydb.closed();
		return userIns;
	}
	

}
